/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package wwcontrolserver.sensor;

//import wwcontrolserver.SensorComputationsServer;
import wwcontrolserver.sensor.AbstractSensor;

/**
 *
 * @author Michael Ferry
 */
//This class is for a thermistor hooked to an 1134_0 Voltage Divider
public class SensorThermistor1134 extends AbstractSensor{
    private static boolean ratiometric = true;
    //The resistance the Voltage divider is set to
    private final double SetResistance1134;
    //The resistance of the thermistor at 25C
    private final int SensorResistanceAt25;
    private final SensorRKey SRKey;
    
    public SensorThermistor1134(int ifkSerial,int SNUM, int CALGROUP, String SNAME,
            double SetResistance1134, int SensorResistanceAt25){
        super(ifkSerial,SNUM,CALGROUP,SNAME);
        this.SetResistance1134=SetResistance1134;
        this.SensorResistanceAt25=SensorResistanceAt25;
        SRKey = new SensorRKey(ifkSerial,ratiometric);
        //this.sensor_mode = sensor_mode;

    }
    @Override
    public double ComputedSensorValue(int SensorRawValue, double DYNR){
        return SensorComputationsServer.ComputeThermistorTemperature(this.SensorResistanceAt25, 
                this.SetResistance1134, SensorRawValue, DYNR);
    }
    @Override
    public boolean GetRatiometric(){
        return ratiometric;
    }
    @Override
     public SensorRKey GetSensorRKey(){
        return SRKey;
    }
}
